<template>
<div>
    <div v-for="(item,index) in filterRowTime" :key="index">
        <span>{{week[index]}}</span>
        <el-time-picker
            is-range
            v-model="rowData.time[index]"
            range-separator="至"
            start-placeholder="开始时间"
            end-placeholder="结束时间"
            placeholder="选择时间范围"
            class="time-colum-box">
        </el-time-picker>
    </div>

</div>
</template>

<script>
import _ from 'lodash';
import { mapState } from 'vuex';

export default {
  data() {
    return {
      week: ['星期一', '星期二', '星期三', '星期四', '星期五', '星期六', '星期日'],
      //   value: [],
    };
  },

  computed: {
    ...mapState({
      rowData: (state) => state.restaurant.rowData,
    }),

    // 选取time数组的前7个
    filterRowTime() {
      // return this.rowData.time.slice(0, 6);

      // console.log(_.get(this, 'rowData.time'));
      return _.get(this, 'rowData.time', []).slice(0, 7); // 给默认值
    },

  },

  created() {
    console.log('created');
  },

  destroyed() {
  },

  methods: {
  },

};
</script>

<style>

</style>
